home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / bbs / Hydra11s.lha / HBBS / Source / Misc / ExternalTest / ExTest.C < prev    next >
C/C++ Source or Header  |  1996-06-25  |  1KB  |  82 lines

  1.  
  2. #include <exec/types.h>
  3. #include <exec/memory.h>
  4. #include <clib/exec_protos.h>
  5. #include <clib/alib_protos.h>
  6.  
  7. #include <stdlib.h>
  8. #include <string.h>
  9. #include <stdio.h>
  10. #include <ctype.h>
  11. #include <time.h>
  12.  
  13.  
  14. #ifdef __SASC
  15. int CXBRK(void) { return(0); }
  16. int _CXBRK(void) { return(0); }
  17. void chkabort(void) {}
  18. #endif
  19.  
  20. #include <HBBS/Defines.h>
  21. #include <HBBS/types.h>
  22. #include <HBBS/structures.h>
  23. #include <HBBS/hbbscommon_protos.h>
  24. #include <HBBS/hbbscommon_pragmas.h>
  25.  
  26. struct Library *HBBSCommonBase=NULL;
  27.  
  28. struct BBSGlobalData *BBSGlobal=NULL;
  29. struct NodeData *N_ND;
  30. static VOID cleanup(ULONG num)
  31. {
  32.   if (HBBSCommonBase)
  33.   {
  34.     HBBS_CleanUpCommon();
  35.     CloseLibrary (HBBSCommonBase);
  36.   }
  37.  
  38.   if (num) printf("Door Error = %d\n",num);
  39.  
  40.   exit(0);
  41. }
  42.  
  43. static VOID init(VOID)
  44. {
  45.   if(!(HBBSCommonBase = OpenLibrary("HBBSCommon.library",0)))
  46.   {
  47.     cleanup(1);
  48.   }
  49.  
  50.   if (!(HBBS_InitCommon()))
  51.   {
  52.     cleanup(2);
  53.   }
  54.  
  55. }
  56.  
  57. void PrintList( struct List *list)
  58. {
  59.   struct Node *node;
  60.   for (node = list->lh_Head ; node->ln_Succ ; node =node->ln_Succ)
  61.   {
  62.     puts(node->ln_Name);
  63.   }
  64. }
  65.  
  66. int main(int argc,char *argv[])
  67. {
  68.   struct CfgFileData *CfgFile=NULL;
  69.  
  70.   init();
  71.  
  72.   if (CfgFile=HBBS_LoadConfig("T:Test.CFG"))
  73.   {
  74.     PrintList(CfgFile->ItemsList);
  75.     HBBS_AddCfgItem(CfgFile,"Item_3","55");
  76.     PrintList(CfgFile->ItemsList);
  77.     HBBS_FlushConfig(CfgFile);
  78.   }
  79.  
  80.   cleanup(0);
  81. }
  82.